<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {name:'zs', age: 12, sex: 'man'}
    // const arr = []
    // for (const k in obj) {
    //   arr.push(k)
    // }
    // console.log(arr);
    // 将对象所有的键收集到一个数组中
    console.log(Object.keys(obj))
    // 将对象所有的值收集到一个数组中
    console.log(Object.values(obj))
  </script>
</body>
</html>